/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.webos.java.base.grid;

import org.json.JSONObject;

/**
 *
 * @author Kostya
 */
abstract public class GridControllerItem <E>{
    private E object;
    private GridController controller = null;
    private String id = "";

    public GridControllerItem(GridController aController, E aObject, String aID) {
        controller = aController;
        object = aObject;
        id = aID;
    }

    public E getObject() {
        return object;
    }

    public String getId() {
        return id;
    }

    public JSONObject getJSONObject(){
        JSONObject object = new JSONObject();
        object.putOpt("id", id);
        objectTOJSON(object);
        return object;
    }

    abstract public void objectTOJSON(JSONObject aObject);
}
